

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
</head>
<body layadmin-themealias="default">

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body" pad15="">
                    <table class="layui-table" lay-skin="line">
                        <colgroup>
                            <col width="100">
                            <col width="150">
                        </colgroup>
                        <tbody>
                        <tr>
                            <td>提现用户ID</td>
                            <td>{$withdrawalsinfo.uid}</td>
                        </tr>
                        <tr>
                            <td>提现金额</td>
                            <td>{$withdrawalsinfo.cash}</td>
                        </tr>
                        <tr>
                            <td>申请时间</td>
                            <td>{:date('Y-m-d H:i:s',$withdrawalsinfo.create_time)}</td>
                        </tr>
                        <tr>
                            <td>银行卡姓名</td>
                            <td>{$withdrawalsinfo.alipay_name}</td>
                        </tr>
                        <tr>
                            <td>银行卡卡号</td>
                            <td>{$withdrawalsinfo.alipay_account}</td>
                        </tr>
                        </tbody>
                    </table>
                    <div class="layui-form" wid100="" lay-filter="">
                        <input type="hidden" name="id" value="{$withdrawalsinfo.id}">
                        <div class="layui-form-item">
                            <div class="layui-input-block text-center">
                                <button class="layui-btn layui-btn-warm" lay-submit="" lay-filter="withdrawals-refuse">拒绝</button>
                                <button class="layui-btn" lay-submit="" lay-filter="withdrawals-confirm">通过</button>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>

<script src="/layuiadmin/layui/layui.js"></script>
<script>
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'admin', 'withdrawals'], function() {
        var $ = layui.$
            ,form = layui.form
            ,admin = layui.admin;
        var index = parent.layer.getFrameIndex(window.name);

        $('#close').on("click",function () {
            parent.layer.close(index);
        });

        form.on('submit(withdrawals-confirm)', function(obj){
            //提交
            admin.req({
                url: '/admin/withdrawals/audit_post'
                ,data: obj.field
                ,success: function(res){
                    if (res.code == 0){
                        parent.layer.close(index);
                        parent.layer.msg(res.msg, {icon: 1});
                        parent.layui.table.reload('LAY-withdrawals-manage');
                    }
                }
            });
            return false;
        });
        form.on('submit(withdrawals-refuse)', function(obj){
            layer.confirm('拒绝提现申请后用户只能重新申请', function(index) {
                let data = obj.field;
                console.log(data);
                data['status'] = 2;
                //提交
                admin.req({
                    url: '/admin/withdrawals/audit_post'
                    , data: obj.field
                    , success: function (res) {
                        if (res.code == 0) {
                            parent.layer.close(index);
                            parent.layer.msg(res.msg, {icon: 1});
                            parent.layui.table.reload('LAY-withdrawals-manage');
                        }
                    }
                });
            });
            return false;
        });
    });
</script>
</body>
</html>
